Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Secure coding</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Secure_coding"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Secure_coding rootpage-Secure_coding skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Secure coding</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1248332772">
/* start https://en.wikipedia.org/ */


.mw-parser-output .multiple-issues-text{width:95%;margin:0.2em 0}.mw-parser-output .multiple-issues-text>.mw-collapsible-content{margin-top:0.3em}.mw-parser-output .compact-ambox .ambox{border:none;border-collapse:collapse;background-color:transparent;margin:0 0 0 1.6em!important;padding:0!important;width:auto;display:block}body.mediawiki .mw-parser-output .compact-ambox .ambox.mbox-small-left{font-size:100%;width:auto;margin:0}.mw-parser-output .compact-ambox .ambox .mbox-text{padding:0!important;margin:0!important}.mw-parser-output .compact-ambox .ambox .mbox-text-span{display:list-item;line-height:1.5em;list-style-type:disc}body.skin-minerva .mw-parser-output .multiple-issues-text>.mw-collapsible-toggle,.mw-parser-output .compact-ambox .ambox .mbox-image,.mw-parser-output .compact-ambox .ambox .mbox-imageright,.mw-parser-output .compact-ambox .ambox .mbox-empty-cell,.mw-parser-output .compact-ambox .hide-when-compact{display:none}


/* end https://en.wikipedia.org/ */
</style>
<p><b>Secure coding</b> is the practice of developing computer <a href="Software" title="Software">software</a> in such a way that guards against the accidental introduction of <a href="Security_vulnerabilities" class="mw-redirect" title="Security vulnerabilities">security vulnerabilities</a>. Defects, <a href="Software_bug" title="Software bug">bugs</a> and logic flaws are consistently the primary cause of commonly exploited software vulnerabilities.<sup id="cite_ref-bss2001_1-0" class="reference"><a href="#cite_note-bss2001-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> Through the analysis of thousands of reported vulnerabilities, security professionals have discovered that most vulnerabilities stem from a relatively small number of common software programming errors. By identifying the insecure coding practices that lead to these errors and educating developers on secure alternatives, organizations can take proactive steps to help significantly reduce or eliminate vulnerabilities in software before deployment.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>Some scholars have suggested that in order to effectively confront threats related to <a href="Computer_security" title="Computer security">cybersecurity</a>, proper security should be coded or “baked in” to the systems. With security being designed into the software, this ensures that there will be protection against insider attacks and reduces the threat to application security.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Buffer-overflow_prevention">Buffer-overflow prevention</h2></div>
<p><a href="Buffer_overflow" title="Buffer overflow">Buffer overflows</a>, a common software security vulnerability, happen when a process tries to store data beyond a fixed-length buffer. For example, if there are 8 slots to store items in, there will be a problem if there is an attempt to store 9 items. In computer memory the overflowed data may overwrite data in the next location which can result in a security vulnerability (stack smashing) or program termination (segmentation fault).<sup id="cite_ref-bss2001_1-1" class="reference"><a href="#cite_note-bss2001-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p><p>
An example of a <a href="C_(programming_language)" title="C (programming language)">C</a> program prone to a buffer overflow is</p><div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">int</span><span class="w"> </span><span class="nf">vulnerable_function</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">large_user_input</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="n">dst</span><span class="p">[</span><span class="n">SMALL</span><span class="p">];</span>
<span class="w"> </span><span class="n">strcpy</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span><span class="w"> </span><span class="n">large_user_input</span><span class="p">);</span>
<span class="p">}</span>
</pre></div><p>If the user input is larger than the destination buffer, a buffer overflow will occur.
To fix this unsafe program, use strncpy to prevent a possible buffer overflow.</p><div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">int</span><span class="w"> </span><span class="nf">secure_function</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">user_input</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="n">dst</span><span class="p">[</span><span class="n">BUF_SIZE</span><span class="p">];</span>
<span class="w"> </span><span class="c1">// copy a maximum of BUF_SIZE bytes</span>
<span class="w"> </span><span class="n">strncpy</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span><span class="w"> </span><span class="n">user_input</span><span class="p">,</span><span class="w"> </span><span class="n">BUF_SIZE</span><span class="p">);</span>
<span class="w"> </span><span class="c1">// set the last character in the buffer to NUL.</span>
<span class="w"> </span><span class="n">dst</span><span class="p">[</span><span class="n">BUF_SIZE</span><span class="w"> </span><span class="mi">-1</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="sc">'\0'</span><span class="p">;</span>
<span class="p">}</span>
</pre></div><p>Another secure alternative is to dynamically allocate memory on the heap using <a href="Malloc" class="mw-redirect" title="Malloc">malloc</a>.</p><div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="nf">secure_copy</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">src</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">size_t</span><span class="w"> </span><span class="n">len</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">strlen</span><span class="p">(</span><span class="n">src</span><span class="p">);</span>
<span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">dst</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">malloc</span><span class="p">(</span><span class="n">len</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">dst</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">strncpy</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span><span class="w"> </span><span class="n">src</span><span class="p">,</span><span class="w"> </span><span class="n">len</span><span class="p">);</span>
<span class="w"> </span><span class="c1">// append null terminator </span>
<span class="w"> </span><span class="n">dst</span><span class="p">[</span><span class="n">len</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="sc">'\0'</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">dst</span><span class="p">;</span>
<span class="p">}</span>
</pre></div><p>In the above code snippet, the program attempts to copy the contents of <i><b>src</b></i> into <i><b>dst</b></i>, while also checking the return value of malloc to ensure that enough memory was able to be allocated for the destination buffer.
</p><div class="mw-heading mw-heading2"><h2 id="Format-string_attack_prevention">Format-string attack prevention</h2></div>
<p>A <a href="Format_string_attacks" class="mw-redirect" title="Format string attacks">Format String Attack</a> is when a malicious user supplies specific inputs that will eventually be entered as an argument to a function that performs formatting, such as <a href="Printf()" class="mw-redirect" title="Printf()">printf()</a>. The attack involves the adversary reading from or writing to the <a href="Call_stack" title="Call stack">stack</a>.
</p><p>
The C printf function writes output to stdout. If the parameter of the printf function is not properly formatted, several security bugs can be introduced. Below is a program that is vulnerable to a format string attack.</p><div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">int</span><span class="w"> </span><span class="nf">vulnerable_print</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">malicious_input</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="n">malicious_input</span><span class="p">);</span>
<span class="p">}</span>
</pre></div><p>A malicious argument passed to the program could be "%s%s%s%s%s%s%s", which can crash the program from improper memory reads.
</p><div class="mw-heading mw-heading2"><h2 id="Integer-overflow_prevention">Integer-overflow prevention</h2></div>
<p><a href="Integer_overflow" title="Integer overflow">Integer overflow</a> occurs when an arithmetic operation results in an integer too large to be represented within the available space. A program which does not properly check for integer overflow introduces potential software bugs and exploits.
</p><p>Below is a function in <a href="C%2B%2B" title="C++">C++</a> which attempts to confirm that the sum of x and y is less than or equal to a defined value MAX:
</p>
<div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">bool</span><span class="w"> </span><span class="nf">sumIsValid_flawed</span><span class="p">(</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">y</span><span class="p">;</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="n">MAX</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>The problem with the code is it does not check for integer overflow on the addition operation. If the sum of x and y is greater than the maximum possible value of an <code>unsigned int</code>, the addition operation will overflow and perhaps result in a value less than or equal to MAX, even though the sum of x and y is greater than MAX.
</p><p>Below is a function which checks for overflow by confirming the sum is greater than or equal to both x and y. If the sum did overflow, the sum would be less than x or less than y.
</p>
<div class="mw-highlight mw-highlight-lang-c++ mw-content-ltr" dir="ltr"><pre><span class="kt">bool</span><span class="w"> </span><span class="nf">sumIsValid_secure</span><span class="p">(</span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">unsigned</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">y</span><span class="p">;</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="n">MAX</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Path_traversal_prevention">Path traversal prevention</h2></div>
<p>Path traversal is a vulnerability whereby paths provided from an untrusted source are interpreted in such a way that unauthorised file access is possible.
</p><p>For example, consider a script that fetches an article by taking a filename, which is then read by the script and <a href="Parse" class="mw-redirect" title="Parse">parsed</a>. Such a script might use the following hypothetical URL to retrieve an article about <a href="Dog_food" title="Dog food">dog food</a>:
</p>
<pre>https://www.example.net/cgi-bin/article.sh?name=dogfood.html
</pre>
<p>If the script has no input checking, instead trusting that the filename is always valid, a <a href="Malicious_user" class="mw-redirect" title="Malicious user">malicious user</a> could forge a URL to retrieve configuration files from the web server:
</p>
<pre>https://www.example.net/cgi-bin/article.sh?name=../../../../../etc/passwd
</pre>
<p>Depending on the script, this may expose the <a href="Passwd#Password_file" title="Passwd">/etc/passwd</a> file, which on <a href="Unix-like" title="Unix-like">Unix-like</a> systems contains (among others) <a href="User_identifier_(Unix)" class="mw-redirect" title="User identifier (Unix)">user IDs</a>, their <a href="Username" class="mw-redirect" title="Username">login names</a>, <a href="Home_directory" title="Home directory">home directory</a> paths and <a href="Operating_system_shell" class="mw-redirect" title="Operating system shell">shells</a>. (See <a href="SQL_injection" title="SQL injection">SQL injection</a> for a similar attack.)
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Application_security" title="Application security">Application Security</a></li>
<li><a href="Defensive_programming" title="Defensive programming">Defensive programming</a></li>
<li><a href="Security_bug" title="Security bug">Security bug</a></li>
<li>Secure by default</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-bss2001-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-bss2001_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-bss2001_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFViegaGary_McGraw2001" class="citation book cs1">Viega, John; Gary McGraw (2001). <i>Building Secure Software: How to Avoid Security Problems the Right Way</i>. MAddison-Wesley Professional. p.&nbsp;528. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0201721522</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFTaylorAzadegan2006" class="citation book cs1">Taylor, Blair; Azadegan, Shiva (2006-09-22). <a rel="nofollow" class="external text" href="https://doi.org/10.1145/1231047.1231053">"Threading secure coding principles and risk analysis into the undergraduate computer science and information systems curriculum"</a>. <i>Proceedings of the 3rd annual conference on Information security curriculum development</i>. InfoSecCD '06. Kennesaw, Georgia: Association for Computing Machinery. pp.&nbsp;<span class="nowrap">24–</span>29. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1231047.1231053">10.1145/1231047.1231053</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-59593-437-6</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2452783">2452783</a>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFRussell_L2004" class="citation journal cs1">Russell L, Jones (Dec 2004). <a rel="nofollow" class="external text" href="https://www.proquest.com/docview/229507883">"Secure Coding: Building Security into the Software Development Life Cycle"</a>. <i>Information Systems Security</i>. <a href="ProQuest" title="ProQuest">ProQuest</a>&nbsp;<a rel="nofollow" class="external text" href="https://www.proquest.com/docview/229507883">229507883</a>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<ul><li><cite id="CITEREFTaylorBrian_BuegeRandy_Layman2006" class="citation book cs1">Taylor, Art; Brian Buege; Randy Layman (2006). <i>Hacking Exposed J2EE &amp; Java</i>. McGraw-Hill Primis. p.&nbsp;426. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-390-59975-1</bdi>.</cite></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Information_security92" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="3"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div id="Information_security92" style="font-size:114%;margin:0 4em"><a href="Information_security" title="Information security">Information security</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Threat_(computer)" class="mw-redirect" title="Threat (computer)">Threats</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Adware" title="Adware">Adware</a></li>
<li><a href="Advanced_persistent_threat" title="Advanced persistent threat">Advanced persistent threat</a></li>
<li><a href="Arbitrary_code_execution" title="Arbitrary code execution">Arbitrary code execution</a></li>
<li><a href="Backdoor_(computing)" title="Backdoor (computing)">Backdoors</a></li>
<li>Bombs
<ul><li><a href="Fork_bomb" title="Fork bomb">Fork</a></li>
<li><a href="Logic_bomb" title="Logic bomb">Logic</a></li>
<li><a href="Time_bomb_(software)" title="Time bomb (software)">Time</a></li>
<li><a href="Zip_bomb" title="Zip bomb">Zip</a></li></ul></li>
<li><a href="Hardware_backdoor" title="Hardware backdoor">Hardware backdoors</a></li>
<li><a href="Code_injection" title="Code injection">Code injection</a></li>
<li><a href="Crimeware" title="Crimeware">Crimeware</a></li>
<li><a href="Cross-site_scripting" title="Cross-site scripting">Cross-site scripting</a></li>
<li><a href="Cross-site_leaks" title="Cross-site leaks">Cross-site leaks</a></li>
<li><a href="DOM_clobbering" title="DOM clobbering">DOM clobbering</a></li>
<li><a href="History_sniffing" title="History sniffing">History sniffing</a></li>
<li><a href="Cryptojacking" title="Cryptojacking">Cryptojacking</a></li>
<li><a href="Botnet" title="Botnet">Botnets</a></li>
<li><a href="Data_breach" title="Data breach">Data breach</a></li>
<li><a href="Drive-by_download" title="Drive-by download">Drive-by download</a></li>
<li><a href="Browser_Helper_Object" title="Browser Helper Object">Browser Helper Objects</a></li>
<li><a href="Computer_virus" title="Computer virus">Viruses</a></li>
<li><a href="Data_scraping" title="Data scraping">Data scraping</a></li>
<li><a href="Denial-of-service_attack" title="Denial-of-service attack">Denial-of-service attack</a></li>
<li><a href="Eavesdropping" title="Eavesdropping">Eavesdropping</a></li>
<li><a href="Email_fraud" title="Email fraud">Email fraud</a></li>
<li><a href="Email_spoofing" title="Email spoofing">Email spoofing</a></li>
<li><a href="Exploit_(computer_security)" title="Exploit (computer security)">Exploits</a></li>
<li><a href="Dialer#Fraudulent_dialer" title="Dialer">Fraudulent dialers</a></li>
<li><a href="Hacktivism" title="Hacktivism">Hacktivism</a></li>
<li><a href="Infostealer" title="Infostealer">Infostealer</a></li>
<li><a href="Insecure_direct_object_reference" title="Insecure direct object reference">Insecure direct object reference</a></li>
<li><a href="Keystroke_logging" title="Keystroke logging">Keystroke loggers</a></li>
<li><a href="Malware" title="Malware">Malware</a></li>
<li><a href="Payload_(computing)" title="Payload (computing)">Payload</a></li>
<li><a href="Phishing" title="Phishing">Phishing</a>
<ul><li><a href="Voice_phishing" title="Voice phishing">Voice</a></li></ul></li>
<li><a href="Polymorphic_engine" title="Polymorphic engine">Polymorphic engine</a></li>
<li><a href="Privilege_escalation" title="Privilege escalation">Privilege escalation</a></li>
<li><a href="Ransomware" title="Ransomware">Ransomware</a></li>
<li><a href="Rootkit" title="Rootkit">Rootkits</a></li>
<li><a href="Scareware" title="Scareware">Scareware</a></li>
<li><a href="Shellcode" title="Shellcode">Shellcode</a></li>
<li><a href="Spamming" title="Spamming">Spamming</a></li>
<li><a href="Social_engineering_(security)" title="Social engineering (security)">Social engineering</a></li>
<li><a href="Spyware" title="Spyware">Spyware</a></li>
<li><a href="Software_bug" title="Software bug">Software bugs</a></li>
<li><a href="Trojan_horse_(computing)" title="Trojan horse (computing)">Trojan horses</a></li>
<li><a href="Hardware_Trojan" title="Hardware Trojan">Hardware Trojans</a></li>
<li><a href="Remote_access_trojan" class="mw-redirect" title="Remote access trojan">Remote access trojans</a></li>
<li><a href="Vulnerability_(computer_security)" title="Vulnerability (computer security)">Vulnerability</a></li>
<li><a href="Web_shell" title="Web shell">Web shells</a></li>
<li><a href="Wiper_(malware)" title="Wiper (malware)">Wiper</a></li>
<li><a href="Computer_worm" title="Computer worm">Worms</a></li>
<li><a href="SQL_injection" title="SQL injection">SQL injection</a></li>
<li><a href="Rogue_security_software" title="Rogue security software">Rogue security software</a></li>
<li><a href="Zombie_(computing)" title="Zombie (computing)">Zombie</a></li></ul>
</div></td><td class="noviewer navbox-image" rowspan="3" style="width:1px;padding:0 0 0 2px"><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Defenses</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Application_security" title="Application security">Application security</a>
<ul>
<li>Secure by default</li>
<li><a href="Secure_by_design" title="Secure by design">Secure by design</a>
<ul><li><a href="Misuse_case" title="Misuse case">Misuse case</a></li></ul></li></ul></li>
<li><a href="Computer_access_control" title="Computer access control">Computer access control</a>
<ul><li><a href="Authentication" title="Authentication">Authentication</a>
<ul><li><a href="Multi-factor_authentication" title="Multi-factor authentication">Multi-factor authentication</a></li></ul></li>
<li><a href="Authorization" title="Authorization">Authorization</a></li></ul></li>
<li><a href="Computer_security_software" title="Computer security software">Computer security software</a>
<ul><li><a href="Antivirus_software" title="Antivirus software">Antivirus software</a></li>
<li><a href="Security-focused_operating_system" title="Security-focused operating system">Security-focused operating system</a></li></ul></li>
<li><a href="Data-centric_security" title="Data-centric security">Data-centric security</a></li>
<li><a href="Obfuscation_(software)" title="Obfuscation (software)">Software obfuscation</a></li>
<li><a href="Data_masking" title="Data masking">Data masking</a></li>
<li><a href="Encryption" title="Encryption">Encryption</a></li>
<li><a href="Firewall_(computing)" title="Firewall (computing)">Firewall</a></li>
<li><a href="Intrusion_detection_system" title="Intrusion detection system">Intrusion detection system</a>
<ul><li><a href="Host-based_intrusion_detection_system" title="Host-based intrusion detection system">Host-based intrusion detection system</a> (HIDS)</li>
<li><a href="Anomaly_detection" title="Anomaly detection">Anomaly detection</a></li></ul></li>
<li><a href="Information_security_management" title="Information security management">Information security management</a>
<ul><li><a href="Information_risk_management" class="mw-redirect" title="Information risk management">Information risk management</a></li>
<li><a href="Security_information_and_event_management" title="Security information and event management">Security information and event management</a> (SIEM)</li></ul></li>
<li><a href="Runtime_application_self-protection" title="Runtime application self-protection">Runtime application self-protection</a></li>
<li><a href="Site_isolation" title="Site isolation">Site isolation</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Related<br>security<br>topics</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Computer_security" title="Computer security">Computer security</a></li>
<li><a href="Automotive_security" title="Automotive security">Automotive security</a></li>
<li><a href="Cybercrime" title="Cybercrime">Cybercrime</a>
<ul><li><a href="Cybersex_trafficking" title="Cybersex trafficking">Cybersex trafficking</a></li>
<li><a href="Computer_fraud" title="Computer fraud">Computer fraud</a></li></ul></li>
<li><a href="Cybergeddon" title="Cybergeddon">Cybergeddon</a></li>
<li><a href="Cyberterrorism" title="Cyberterrorism">Cyberterrorism</a></li>
<li><a href="Cyberwarfare" title="Cyberwarfare">Cyberwarfare</a></li>
<li><a href="Electronic_warfare" title="Electronic warfare">Electronic warfare</a></li>
<li><a href="Information_warfare" title="Information warfare">Information warfare</a></li>
<li><a href="Internet_security" title="Internet security">Internet security</a></li>
<li><a href="Mobile_security" title="Mobile security">Mobile security</a></li>
<li><a href="Network_security" title="Network security">Network security</a></li>
<li><a href="Copy_protection" title="Copy protection">Copy protection</a></li>
<li><a href="Digital_rights_management" title="Digital rights management">Digital rights management</a></li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-09-01" href="https://en.wikipedia.org/wiki/?title=Secure_coding&amp;oldid=1243472002">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>